import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<BottomTabbarState> buildReducer() {
  return asReducer(
    <Object, Reducer<BottomTabbarState>>{
      BottomTabbarAction.action: _onAction,
      BottomTabbarAction.upCurrentIndex: _upCurrentIndex,

    },
  );
}

BottomTabbarState _onAction(BottomTabbarState state, Action action) {
  final BottomTabbarState newState = state.clone();
  return newState;
}

BottomTabbarState _upCurrentIndex(BottomTabbarState state, Action action) {
  final BottomTabbarState newState = state.clone();
  newState.currentIndex = action.payload;
  return newState;
}
